home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
AVOGADRO
/
CHEMISTRY
/
MOLEDRAW
/
!MoleDraw
/
docs
/
DrawFiles
next >
Wrap
Text File
|
1996-04-09
|
6KB
|
178 lines
DrawFiles produced by MoleDraw
==============================
A MoleDraw file is simply a DrawFile with a connection table object. This
describes the positions of the atoms in the drawing, how they are connected,
and how they are labelled.
Bonding and label data in the connection table implies the presence of
associated bond and label objects in the file. These bonds and labels are
constructed from normal Draw objects. The objects for each bond or label are
held together in a group and wrapped up in a tagged object.
Two other tagged objects are used. Firstly, aromatic ring objects. These
are the circles placed in the centre of aromatic rings. They are used during
SMILES string generation to determine aromaticity. No data is associated
with them. The final type of tagged objects are arrow heads. These are
tagged so they may be altered by the 'Style' menu.
The file "!MoleDraw.docs.mdobjs" is a C header file containing constants
and structures that can be used when dealing with MoleDraw files. Below is a
brief description of the data stored in them.
Connection table (Draw object number 0x1C0)
===========================================
This has a normal Draw object header, except that the bounding box has no
meaning (as the object is invisible), and so is set to 0,0,0,0.
Following the header we have,
bytes value
4 number of atoms, N.
Followed by N times,
bytes value
4 X coord of atom, in Draw units.
4 Y coord of atom, in Draw units.
32 an array of 8, 4 byte integers, specifying which atoms this one
is bonded to. Values of -1 => no bond. For example if this atom
was bonded to atoms 4, 5 and 9 this array would contain,
4,5,9,-1,-1,-1,-1,-1
or some permutation thereof. Note in particular that the -1's
may be interspersed with the other numbers.
An atom's number is simply it's index in the connection table.
Numbering of atoms starts at 0.
8 an array of 8, 1 byte integers. For each of the above bonds the
bond order is stored in the corresponding entry in this array.
If the value in the above array is -1, then the entry in this
array is not valid. Only values between 0 and 3 are allowed.
24 an 8 by 3 array of 1 byte integers. For each component of the
bonds specified by the above two arrays this array stores the
type of bond (eg dashed, solid etc). The types are given below.
1 the type of label this atom has. The types are given below.
3 three 0 bytes, to pad the atom data to a word boundary.
bond types,
0 solid line.
1 dashed line.
2 bold line.
3 bold, dashed line.
4 solid wedge (thin end at this atom).
5 dashed wedge (thin end at this atom).
6 solid wedge (thick end at this atom).
7 dashed wedge (thick end at this atom).
8 wiggly bond.
in addition components of double bonds (ie those with bond order 2) may
have bit 4 set, this implies that the two components of the bond are centred
about the line joining the two atoms they connect, as opposed to one
component lying on the line and the other being on one side of it. If this
is a little unclear; clicking with shift held down over a double bond in
MoleDraw alters the state of this bit.
label types,
0 this atom is not labelled.
1 this atom is labelled with a dot.
2 this atom is labelled with text, the left most character in
the text is at the atom.
3 the central character in the text is at the atom.
4 the right most character in the text is at the atom.
5 the text is vertical, above the atom.
6 the text is vertical, below the atom.
Tagged bond objects
===================
Bonds objects are stored as follows,
tagged object header
bond tag number (0x800)
group object
{
bond one object
bond two object
...
bond N object
}
bond tag data, 4 byte integer A1
4 byte integer A2
Where N is the bond order between atoms A1 and A2, and A1 < A2.
Note: You should not rely on single bonds (these will have only one bond
object) being wrapped in a group, as this may change at some future date.
Tagged label objects
====================
Label objects are stored as follows,
for atoms labelled with text,
tagged object header
label tag number (0x801)
group object
{
path object (used as a rubbout box)
[group of] text object[s]
}
label tag data, 4 byte integer A
for atoms labelled with a dot,
tagged object header
label tag number (0x801)
path object
label tag data, 4 byte integer A
Where A is the atom this label is associated with.
Tagged aromatic ring objects
============================
Only the presence or absence of these objects needs to be known, so no
data is stored with them.
tagged object header
aromatic ring tag number (0x802)
path object
Tagged arrow head objects
=========================
These have an integer representing their current style stored with them.
The style numbers start at 0, and correspond to the types used in the 'Arrow
Heads' menu.
tagged object header
arrow head tag number (0x803)
path object
arrow head tag data, 4 byte integer S
Currently allowed values for S are 0,1,2,3. This range may increase in
the future, but these first 4 values will still represent the same styles.
Notes
=====
The connection table object number and the tagged object numbers have
been registered with Acorn. So you may gleefully use them to your hearts
content, happy in the knowledge that there will be no compatibility problems
with future DrawFile producing programs.
---
Simon Kilvington, 9/4/96.